#include "widget.h"
#include "ui_widget.h"
#include <QDebug>

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);
    srand(time(0));
}

Widget::~Widget()
{
    delete ui;
}

void Widget::on_pushButton_clicked()
{

}

void Widget::on_pushButton_agree_clicked()
{
    ui->label->setText("听话的人是不用吃抢仔的.");
}

void Widget::on_pushButton_refuse_clicked()
{
//    QRect rect = ui->pushButton_refuse->geometry();
//    int x = rand() % rect.width();
//    int y = rand() % rect.height();
//    ui->pushButton_refuse->move(x, y);
}

void Widget::on_pushButton_refuse_pressed()
{
    QRect rect = ui->pushButton_refuse->geometry();
    int x = rand() % rect.width();
    int y = rand() % rect.height();
    ui->pushButton_refuse->move(x, y);
}
